<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body>
<form class="layui-form" action="">


    <div class="layui-inline">
        <label class="layui-form-label">第一批截至日期：</label>
        <div class="layui-input-inline">
            <input type="text"  class="layui-input" id="date1" placeholder="yyyy-mm-dd" >
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">第二批截至日期：</label>
        <div class="layui-input-inline">
            <input type="text"  class="layui-input" id="date2" placeholder="yyyy-mm-dd" >
        </div>
    </div>

    <div class="layui-inline">
        <label class="layui-form-label">第三批截至日期：</label>
        <div class="layui-input-inline">
            <input type="text"  class="layui-input" id="date3" placeholder="yyyy-mm-dd" >
        </div>
    </div>
    <div style="margin-top: 20px;margin-left: 70px">
        <button type="button" id="tijiao" lay-submit lay-filter="formDemo" CLASS="layui-btn tijiao">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">名额设置</label>
        <div class="layui-input-block">
            <input type="text" id="number" required  lay-verify="required" placeholder="请输入名额个数" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div style="margin-top: 20px;margin-left: 70px">
        <button type="button" id="tijiao1" lay-submit lay-filter="formDemo" CLASS="layui-btn tijiao">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>

</form>
<script src="../layui/layui.js" charset="utf-8"></script>
<script src="../js/jquery.min.js"></script>
<script>
    layui.use('laydate', function() {
        let laydate = layui.laydate;

        //常规用法
        laydate.render({
            elem: '#date1'
            ,trigger: 'click'
        });
        laydate.render({
            elem: '#date2'
            ,trigger: 'click'
        });
        laydate.render({
            elem: '#date3'
            ,trigger: 'click'
        });
    });
    $("#tijiao").click(function () {
        $.ajax({
            url: "/admin/gengXinById",
            method: "post",
            contentType: "application/json",
            data: JSON.stringify({
                v1time: $("#date1").val(),
                v2time: $("#date2").val(),
                v3time: $("#date3").val(),
            }),
            success: function (res) {
                if (res.code == 200) {
                   alert("修改成功");

                } else {
                    alert("修改失败");
                }
                layer.close();


            }

        })
    });
    $("#tijiao1").click(function () {
        $.ajax({
            url: "/teacher/updateStudentNumber",
            method: "post",
            contentType: "application/json",
            data: JSON.stringify({
                snumber:$("#number").val()
            }),
            success: function (res) {
                if (res.code == 200) {
                    alert("修改成功");

                } else {
                    alert("修改失败");
                }
                layer.close();


            }

        })
    });


</script>
</body>
</html>